package IO;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @author wuhan
 * @date 2019/10/9 15:55
 * IO异常处理
 */
public class Demo2 {
    public static void main(String[] args) {
        FileWriter fw = null;
        try {
            fw=new FileWriter("demo.txt");
            fw.write("ad\r\nas");
        } catch (IOException e) {
            System.out.println(e.toString());
        }
        finally {
            try {
                assert fw != null;
                fw.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
